package main

import (
	"fmt"
	"os"
)

func GenerateSQLFile(filename string, allData []map[string]string) error {
	f, err := os.Create(filename)
	if err != nil {
		return err
	}
	defer f.Close()

	for _, row := range allData {
		query := fmt.Sprintf("INSERT INTO table_name (col1, col2, ...) VALUES ('%s', '%s', ...);", row["学生姓名"], row["课程方式"]) // 根据你的数据结构调整
		_, err := f.WriteString(query + "\n")
		if err != nil {
			return err
		}
	}
	return nil
}
